#ifndef wu_MOSSAIC_H
#define wu_MOSSAIC_H

#pragma once
#include "wuBaseSkin.h"
#include "wuBase2d.h"
#include "wuSolidRectangle.h"

class wuMossaic : public wuBaseSkin, public wuBase2d
{
    public:
        wuMossaic();
        ~wuMossaic();

		void setup(ofxBox2d * _box2d, ofImage *_skin, ofRectangle rect, vector <ofPoint> *countourPts);
//		void makeComplexBody(b2Body* body, vector <ofPoint> *countourPts);
        void setPhysics(float _density, float _bounce, float _friction);
		void update();
        void draw(bool pinta_bg=false, int offX=0);
        void drawSelected(bool pinta_bg, int offX, ofRectangle _selection);
        void clear(void);
        void clear(ofRectangle _selection);
		void touch(int _x,int _y, int forceX=30, int forceY=0);
        void desintegration(bool _des);
        vector <ofPoint> getPosition();
        void setPosition(vector <ofPoint> positions);
        void stop_gravity();


		// box2d
        b2Body* body;

        ofPolyline	shape;
        vector <wuSolidRectangle>	triangles;
        ofxBox2dPolygon poly;

        bool bDesintegration;

};
#endif

